﻿@model IEnumerable<Attachment>
@Html.Extra()
@{
    var images = new string[] { ".jpge", ".jpg", ".png", ".gif", ".bmp" };
}
<table>
    <thead>
        <tr>
            <th>名称</th>
            <th>版本号</th>
            <th>创建时间</th>
        </tr>
    </thead>
    <tbody>
        @foreach (var item in Model)
        {
            <tr id="@item.Key">
                <td>
                    @if (images.Contains(item.FileExtension.ToLower()))
                    {
                        @Html.Image(item.Url, null, new { style = "max-height: 100px; height: auto !important; _height: 100px;" })
                    }
                    else
                    {
                        <span>
                            @item.FileName
                        </span>
                    }
                </td>
                <td>
                    @item.VersionNo
                </td>
                <td>
                    @StringHelper.FormatDateAndTime(item.CreateTime)
                </td>
            </tr>
        }
    </tbody>
</table>
